import { defineStore } from 'pinia'

const useDefStore = defineStore('storeId', {
  state: () => ({
    // all these properties will have their type inferred automatically
    count: 0,
  }),
  getters: {
    isEven: state => state.count % 2 === 0,
  },
  actions: {
    synIncrease() {
      this.count += 1
    },
    async asyncIncrease() {
      await new Promise(resolve => setTimeout(resolve, 1000))
      this.count += 1
    },
  },
})

export default useDefStore
